<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html lang="en">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  <title>LCOV - mbi.info - /usr/local/include/boost/ref.hpp</title>
  <link rel="stylesheet" type="text/css" href="../../../../gcov.css">
</head>

<body>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="title">LTP GCOV extension - code coverage report</td></tr>
    <tr><td class="ruler"><img src="../../../../glass.png" width=3 height=3 alt=""></td></tr>

    <tr>
      <td width="100%">
        <table cellpadding=1 border=0 width="100%">
        <tr>
          <td class="headerItem" width="20%">Current&nbsp;view:</td>
          <td class="headerValue" width="80%" colspan=4><a href="../../../../index.html">directory</a> - <a href="index.html">usr/local/include/boost</a> - ref.hpp</td>
        </tr>
        <tr>
          <td class="headerItem" width="20%">Test:</td>
          <td class="headerValue" width="80%" colspan=4>mbi.info</td>
        </tr>
        <tr>
          <td class="headerItem" width="20%">Date:</td>
          <td class="headerValue" width="20%">2010-01-23</td>
          <td width="20%"></td>
          <td class="headerItem" width="20%">Instrumented&nbsp;lines:</td>
          <td class="headerValue" width="20%">4</td>
        </tr>
        <tr>
          <td class="headerItem" width="20%">Code&nbsp;covered:</td>
          <td class="headerValue" width="20%">0.0 %</td>
          <td width="20%"></td>
          <td class="headerItem" width="20%">Executed&nbsp;lines:</td>
          <td class="headerValue" width="20%">0</td>
        </tr>
        </table>
      </td>
    </tr>
    <tr><td class="ruler"><img src="../../../../glass.png" width=3 height=3 alt=""></td></tr>
  </table>

  <table cellpadding=0 cellspacing=0 border=0>
    <tr>
      <td><br></td>
    </tr>
    <tr>
      <td><pre class="source">
<span class="lineNum">       1 </span>                : #ifndef BOOST_REF_HPP_INCLUDED
<span class="lineNum">       2 </span>                : #define BOOST_REF_HPP_INCLUDED
<span class="lineNum">       3 </span>                : 
<span class="lineNum">       4 </span>                : // MS compatible compilers support #pragma once
<span class="lineNum">       5 </span>                : 
<span class="lineNum">       6 </span>                : #if defined(_MSC_VER) &amp;&amp; (_MSC_VER &gt;= 1020)
<span class="lineNum">       7 </span>                : # pragma once
<span class="lineNum">       8 </span>                : #endif
<span class="lineNum">       9 </span>                : 
<span class="lineNum">      10 </span>                : #include &lt;boost/config.hpp&gt;
<span class="lineNum">      11 </span>                : #include &lt;boost/utility/addressof.hpp&gt;
<span class="lineNum">      12 </span>                : #include &lt;boost/mpl/bool.hpp&gt;
<span class="lineNum">      13 </span>                : #include &lt;boost/detail/workaround.hpp&gt;
<span class="lineNum">      14 </span>                : 
<span class="lineNum">      15 </span>                : //
<span class="lineNum">      16 </span>                : //  ref.hpp - ref/cref, useful helper functions
<span class="lineNum">      17 </span>                : //
<span class="lineNum">      18 </span>                : //  Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
<span class="lineNum">      19 </span>                : //  Copyright (C) 2001, 2002 Peter Dimov
<span class="lineNum">      20 </span>                : //  Copyright (C) 2002 David Abrahams
<span class="lineNum">      21 </span>                : //
<span class="lineNum">      22 </span>                : // Distributed under the Boost Software License, Version 1.0. (See
<span class="lineNum">      23 </span>                : // accompanying file LICENSE_1_0.txt or copy at
<span class="lineNum">      24 </span>                : // http://www.boost.org/LICENSE_1_0.txt)
<span class="lineNum">      25 </span>                : //
<span class="lineNum">      26 </span>                : //  See http://www.boost.org/libs/bind/ref.html for documentation.
<span class="lineNum">      27 </span>                : //
<span class="lineNum">      28 </span>                : 
<span class="lineNum">      29 </span>                : namespace boost
<span class="lineNum">      30 </span>                : {
<span class="lineNum">      31 </span>                : 
<span class="lineNum">      32 </span>                : template&lt;class T&gt; class reference_wrapper
<span class="lineNum">      33 </span>                : { 
<span class="lineNum">      34 </span>                : public:
<span class="lineNum">      35 </span>                :     typedef T type;
<span class="lineNum">      36 </span>                : 
<span class="lineNum">      37 </span>                : #if defined( BOOST_MSVC ) &amp;&amp; BOOST_WORKAROUND( BOOST_MSVC, &lt; 1300 )
<span class="lineNum">      38 </span>                : 
<span class="lineNum">      39 </span>                :     explicit reference_wrapper(T&amp; t): t_(&amp;t) {}
<span class="lineNum">      40 </span>                : 
<span class="lineNum">      41 </span>                : #else
<span class="lineNum">      42 </span>                : 
<span class="lineNum">      43 </span><span class="lineNoCov">              0 :     explicit reference_wrapper(T&amp; t): t_(boost::addressof(t)) {}</span>
<span class="lineNum">      44 </span>                : 
<span class="lineNum">      45 </span>                : #endif
<span class="lineNum">      46 </span>                : 
<span class="lineNum">      47 </span>                :     operator T&amp; () const { return *t_; }
<span class="lineNum">      48 </span>                : 
<span class="lineNum">      49 </span><span class="lineNoCov">              0 :     T&amp; get() const { return *t_; }</span>
<span class="lineNum">      50 </span>                : 
<span class="lineNum">      51 </span>                :     T* get_pointer() const { return t_; }
<span class="lineNum">      52 </span>                : 
<span class="lineNum">      53 </span>                : private:
<span class="lineNum">      54 </span>                : 
<span class="lineNum">      55 </span>                :     T* t_;
<span class="lineNum">      56 </span>                : };
<span class="lineNum">      57 </span>                : 
<span class="lineNum">      58 </span>                : # if defined( __BORLANDC__ ) &amp;&amp; BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT(0x581) )
<span class="lineNum">      59 </span>                : #  define BOOST_REF_CONST
<span class="lineNum">      60 </span>                : # else
<span class="lineNum">      61 </span>                : #  define BOOST_REF_CONST const
<span class="lineNum">      62 </span>                : # endif
<span class="lineNum">      63 </span>                : 
<span class="lineNum">      64 </span><span class="lineNoCov">              0 : template&lt;class T&gt; inline reference_wrapper&lt;T&gt; BOOST_REF_CONST ref(T &amp; t)</span>
<span class="lineNum">      65 </span>                : { 
<span class="lineNum">      66 </span><span class="lineNoCov">              0 :     return reference_wrapper&lt;T&gt;(t);</span>
<span class="lineNum">      67 </span>                : }
<span class="lineNum">      68 </span>                : 
<span class="lineNum">      69 </span>                : template&lt;class T&gt; inline reference_wrapper&lt;T const&gt; BOOST_REF_CONST cref(T const &amp; t)
<span class="lineNum">      70 </span>                : {
<span class="lineNum">      71 </span>                :     return reference_wrapper&lt;T const&gt;(t);
<span class="lineNum">      72 </span>                : }
<span class="lineNum">      73 </span>                : 
<span class="lineNum">      74 </span>                : # undef BOOST_REF_CONST
<span class="lineNum">      75 </span>                : 
<span class="lineNum">      76 </span>                : # ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
<span class="lineNum">      77 </span>                : 
<span class="lineNum">      78 </span>                : template&lt;typename T&gt;
<span class="lineNum">      79 </span>                : class is_reference_wrapper
<span class="lineNum">      80 </span>                :     : public mpl::false_
<span class="lineNum">      81 </span>                : {
<span class="lineNum">      82 </span>                : };
<span class="lineNum">      83 </span>                : 
<span class="lineNum">      84 </span>                : template&lt;typename T&gt;
<span class="lineNum">      85 </span>                : class unwrap_reference
<span class="lineNum">      86 </span>                : {
<span class="lineNum">      87 </span>                :  public:
<span class="lineNum">      88 </span>                :     typedef T type;
<span class="lineNum">      89 </span>                : };
<span class="lineNum">      90 </span>                : 
<span class="lineNum">      91 </span>                : #  define AUX_REFERENCE_WRAPPER_METAFUNCTIONS_DEF(X) \
<span class="lineNum">      92 </span>                : template&lt;typename T&gt; \
<span class="lineNum">      93 </span>                : class is_reference_wrapper&lt; X &gt; \
<span class="lineNum">      94 </span>                :     : public mpl::true_ \
<span class="lineNum">      95 </span>                : { \
<span class="lineNum">      96 </span>                : }; \
<span class="lineNum">      97 </span>                : \
<span class="lineNum">      98 </span>                : template&lt;typename T&gt; \
<span class="lineNum">      99 </span>                : class unwrap_reference&lt; X &gt; \
<span class="lineNum">     100 </span>                : { \
<span class="lineNum">     101 </span>                :  public: \
<span class="lineNum">     102 </span>                :     typedef T type; \
<span class="lineNum">     103 </span>                : }; \
<span class="lineNum">     104 </span>                : /**/
<span class="lineNum">     105 </span>                : 
<span class="lineNum">     106 </span>                : AUX_REFERENCE_WRAPPER_METAFUNCTIONS_DEF(reference_wrapper&lt;T&gt;)
<span class="lineNum">     107 </span>                : #if !defined(BOOST_NO_CV_SPECIALIZATIONS)
<span class="lineNum">     108 </span>                : AUX_REFERENCE_WRAPPER_METAFUNCTIONS_DEF(reference_wrapper&lt;T&gt; const)
<span class="lineNum">     109 </span>                : AUX_REFERENCE_WRAPPER_METAFUNCTIONS_DEF(reference_wrapper&lt;T&gt; volatile)
<span class="lineNum">     110 </span>                : AUX_REFERENCE_WRAPPER_METAFUNCTIONS_DEF(reference_wrapper&lt;T&gt; const volatile)
<span class="lineNum">     111 </span>                : #endif
<span class="lineNum">     112 </span>                : 
<span class="lineNum">     113 </span>                : #  undef AUX_REFERENCE_WRAPPER_METAFUNCTIONS_DEF
<span class="lineNum">     114 </span>                : 
<span class="lineNum">     115 </span>                : # else // no partial specialization
<span class="lineNum">     116 </span>                : 
<span class="lineNum">     117 </span>                : } // namespace boost
<span class="lineNum">     118 </span>                : 
<span class="lineNum">     119 </span>                : #include &lt;boost/type.hpp&gt;
<span class="lineNum">     120 </span>                : 
<span class="lineNum">     121 </span>                : namespace boost
<span class="lineNum">     122 </span>                : {
<span class="lineNum">     123 </span>                : 
<span class="lineNum">     124 </span>                : namespace detail
<span class="lineNum">     125 </span>                : {
<span class="lineNum">     126 </span>                :   typedef char (&amp;yes_reference_wrapper_t)[1];
<span class="lineNum">     127 </span>                :   typedef char (&amp;no_reference_wrapper_t)[2];
<span class="lineNum">     128 </span>                :       
<span class="lineNum">     129 </span>                :   no_reference_wrapper_t is_reference_wrapper_test(...);
<span class="lineNum">     130 </span>                : 
<span class="lineNum">     131 </span>                :   template&lt;typename T&gt;
<span class="lineNum">     132 </span>                :   yes_reference_wrapper_t is_reference_wrapper_test(type&lt; reference_wrapper&lt;T&gt; &gt;);
<span class="lineNum">     133 </span>                : 
<span class="lineNum">     134 </span>                :   template&lt;bool wrapped&gt;
<span class="lineNum">     135 </span>                :   struct reference_unwrapper
<span class="lineNum">     136 </span>                :   {
<span class="lineNum">     137 </span>                :       template &lt;class T&gt;
<span class="lineNum">     138 </span>                :       struct apply
<span class="lineNum">     139 </span>                :       {
<span class="lineNum">     140 </span>                :           typedef T type;
<span class="lineNum">     141 </span>                :       };
<span class="lineNum">     142 </span>                :   };
<span class="lineNum">     143 </span>                : 
<span class="lineNum">     144 </span>                :   template&lt;&gt;
<span class="lineNum">     145 </span>                :   struct reference_unwrapper&lt;true&gt;
<span class="lineNum">     146 </span>                :   {
<span class="lineNum">     147 </span>                :       template &lt;class T&gt;
<span class="lineNum">     148 </span>                :       struct apply
<span class="lineNum">     149 </span>                :       {
<span class="lineNum">     150 </span>                :           typedef typename T::type type;
<span class="lineNum">     151 </span>                :       };
<span class="lineNum">     152 </span>                :   };
<span class="lineNum">     153 </span>                : }
<span class="lineNum">     154 </span>                : 
<span class="lineNum">     155 </span>                : template&lt;typename T&gt;
<span class="lineNum">     156 </span>                : class is_reference_wrapper
<span class="lineNum">     157 </span>                : {
<span class="lineNum">     158 </span>                :  public:
<span class="lineNum">     159 </span>                :     BOOST_STATIC_CONSTANT(
<span class="lineNum">     160 </span>                :         bool, value = (
<span class="lineNum">     161 </span>                :              sizeof(detail::is_reference_wrapper_test(type&lt;T&gt;()))
<span class="lineNum">     162 </span>                :             == sizeof(detail::yes_reference_wrapper_t)));
<span class="lineNum">     163 </span>                :     
<span class="lineNum">     164 </span>                :     typedef ::boost::mpl::bool_&lt;value&gt; type;
<span class="lineNum">     165 </span>                : };
<span class="lineNum">     166 </span>                : 
<span class="lineNum">     167 </span>                : template &lt;typename T&gt;
<span class="lineNum">     168 </span>                : class unwrap_reference
<span class="lineNum">     169 </span>                :     : public detail::reference_unwrapper&lt;
<span class="lineNum">     170 </span>                :         is_reference_wrapper&lt;T&gt;::value
<span class="lineNum">     171 </span>                :       &gt;::template apply&lt;T&gt;
<span class="lineNum">     172 </span>                : {};
<span class="lineNum">     173 </span>                : 
<span class="lineNum">     174 </span>                : # endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
<span class="lineNum">     175 </span>                : 
<span class="lineNum">     176 </span>                : template&lt;class T&gt; inline T* get_pointer( reference_wrapper&lt;T&gt; const &amp; r )
<span class="lineNum">     177 </span>                : {
<span class="lineNum">     178 </span>                :     return r.get_pointer();
<span class="lineNum">     179 </span>                : }
<span class="lineNum">     180 </span>                : 
<span class="lineNum">     181 </span>                : } // namespace boost
<span class="lineNum">     182 </span>                : 
<span class="lineNum">     183 </span>                : #endif // #ifndef BOOST_REF_HPP_INCLUDED
</pre>
      </td>
    </tr>
  </table>
  <br>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
  <tr><td class="ruler"><img src="../../../../glass.png" width=3 height=3 alt=""></td></tr>
  <tr><td class="versionInfo">Generated by: <a href="http://ltp.sourceforge.net/coverage/lcov.php" target="_parent">LTP GCOV extension version 1.6</a></td></tr>
  </table>
  <br>

</body>
</html>
